package org.finesys.boot.service.impl;

import lombok.RequiredArgsConstructor;
import org.finesys.common.core.module.DeptDataPermissionEntity;
import org.finesys.common.core.module.R;
import org.finesys.common.security.core.module.AuthUser;
import org.finesys.common.security.core.util.SecurityUtils;
import org.finesys.system.api.service.RoleService;
import org.finesys.system.service.SysRoleService;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor

public class RoleServiceImpl implements RoleService {
    private final SysRoleService sysRoleService;

    public R<DeptDataPermissionEntity> getDataPermission() {
        AuthUser user = SecurityUtils.getUser();
        return R.success(sysRoleService.getDataPermission(user));
    }
}
